package lambda;

public class FlyableDemo {
    public static void main(String[] args) {

        useFlyable(new Flyable() {
            @Override
            public void fly(String s) {
                System.out.println(s);
                System.out.println("plane go to ");
            }
        });
        System.out.println("--------");
        //lambda
        useFlyable((String s) -> {
            System.out.println(s);
            System.out.println("plane ot");
        });
    }

    private static void useFlyable(Flyable f){
        f.fly("sun and night");
    }
}
